//
//  DNScreenFile.swift
//  LunalerApp
//
//  Created by 露乐ios on 2018/2/5.
//  Copyright © 2018年 露乐ios. All rights reserved.
//

import Foundation
import UIKit

let kScreenHeight = UIScreen.main.bounds.size.height
let kScreenWidth  = UIScreen.main.bounds.size.width

let dnAppdelegate = UIApplication.shared.delegate as! AppDelegate

let versionKey = "CFBundleShortVersionString"

let kAppThemeColor = rgba(r: 0x2f,g: 0x88,b: 0xff,a: 1.0)


func rgba(r:CGFloat ,g:CGFloat,b:CGFloat,a:CGFloat) -> UIColor {
    return UIColor.init(red: r/255.0, green: g/255.0, blue: b/255.0, alpha: a)
}

func dnCreatImageWithColor(color:UIColor) -> UIImage{
    
    let rect = CGRect.init(x: 0.0, y: 0.0, width: 1.0, height: 1.0)
    UIGraphicsBeginImageContext(rect.size)
    let context = UIGraphicsGetCurrentContext()
    context!.setFillColor(color.cgColor);
    context!.fill(rect)
    let theImage = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()
    return theImage!
}
